// 用户相关类型
export interface User {
  id: number
  email: string
  nickname: string
  avatar: string
  signature: string
  lastLoginTime: string
  createTime: string
}

export interface LoginForm {
  email: string
  password: string
}

export interface RegisterForm {
  email: string
  password: string
  nickname: string
}

// 消息相关类型
export interface Message {
  id: number
  sessionId: string
  fromUserId: number
  toTargetId: number
  messageType: number
  content: string
  fileUrl?: string
  fileName?: string
  fileSize?: number
  isRecalled: boolean
  sendTime: string
}

export interface Session {
  id: string
  type: 'single' | 'group'
  targetId: number
  targetName: string
  targetAvatar: string
  lastMessage?: Message
  unreadCount: number
  lastActiveTime: string
}

// 好友相关类型
export interface Friend {
  id: number
  userId: number
  friendId: number
  remarkName: string
  isBlocked: boolean
  createTime: string
  friendInfo: User
}

export interface FriendApply {
  id: number
  fromUserId: number
  toUserId: number
  applyReason: string
  status: number
  createTime: string
  fromUserInfo: User
  toUserInfo: User
}

// 群组相关类型
export interface Group {
  id: number
  groupName: string
  avatar: string
  creatorId: number
  announcement: string
  maxMembers: number
  currentMembers: number
  createTime: string
}

export interface GroupMember {
  id: number
  groupId: number
  userId: number
  role: number
  joinTime: string
  userInfo: User
}

// API响应类型
export interface ApiResponse<T = unknown> {
  code: number
  message: string
  data: T
  timestamp: number
}
